<template>
  <!-- 轮播图 -->
  <div>
    <van-swipe class="xmly-swpie" :autoplay="3000">
      <van-swipe-item
        class="swpie-item"
        v-for="(image, id) in swpieList"
        :key="id"
      >
        <img
          v-lazy="image.adFocusPictureDetail.cover"
          class="swipe-img"
          :src="image.adFocusPictureDetail.cover"
        />
      </van-swipe-item>
    </van-swipe>
  </div>
</template>

<script>
  import { getSwpieApi } from "@/api/components";
  export default {
    name: "XmlySwipeItem",
    data() {
      return {
        swpieList: [],
      };
    },

    mounted() {
      this.getSwpie();
    },

    methods: {
      async getSwpie() {
        const result = await getSwpieApi();
        this.swpieList = result.data.moduleContent.focusImages;
        console.log(result, "lunbotu");
      },
    },
  };
</script>

<style lang="less">
  .xmly-swpie {
    width: 100%;
    margin: 10px 0px 0px 0px;
  }
  .swpie-item {
    display: flex;
    justify-content: center;
    align-items: center;
  }
  .swipe-img {
    width: 292px;
    display: block;
    border-radius: 15px;
  }
</style>
